{
 "metadata": {
  "signature": "sha256:0c04a60e0c18150050763b53cf87eee86619fb7871deef2c24f8c73fe95d15a5"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Mayavi: running mayavi 2\n",
      "======================================================================\n",
      "\n",
      "Introduction\n",
      "------------\n",
      "\n",
      "!MayaVi2 works with two kinds of \"objects\": modules and filters.\n",
      "\n",
      "!MayaVi Users Guide (v. 1.5) by P. Ramachandran defines them as follows:\n",
      "\n",
      "`*\u00a0\"A\u00a0Module\u00a0is\u00a0an\u00a0object\u00a0that\u00a0actually\u00a0visualizes\u00a0the\u00a0data.\";`\n",
      "\n",
      "`*\u00a0\"A\u00a0Filter\u00a0is\u00a0an\u00a0object\u00a0that\u00a0filters\u00a0out\u00a0the\u00a0data\u00a0in\u00a0some\u00a0way\u00a0or\u00a0the\u00a0other.\u00a0A\u00a0simple\u00a0example\u00a0is\u00a0the\u00a0!ExtractVectorNorm\u00a0filter.\u00a0This\u00a0extracts\u00a0the\u00a0magnitude\u00a0of\u00a0the\u00a0selected\u00a0vector\u00a0data\u00a0field\u00a0attribute\u00a0for\u00a0the\u00a0data\u00a0file.\u00a0All\u00a0modules\u00a0that\u00a0use\u00a0this\u00a0as\u00a0an\u00a0input\u00a0will\u00a0receive\u00a0the\u00a0vector\u00a0magnitude\u00a0as\u00a0the\u00a0scalar\u00a0field\u00a0data.\"`\n",
      "\n",
      "You can run !MayaVi2 using one of the following two ways:\n",
      "\n",
      "`*\u00a0run\u00a0!MayaVi2\u00a0as\u00a0is,\u00a0without\u00a0any\u00a0options\u00a0on\u00a0the\u00a0command\u00a0line.\u00a0You'll\u00a0manage\u00a0modules\u00a0and/or\u00a0filters\u00a0using\u00a0the\u00a0GUI;`\n",
      "\n",
      "`*\u00a0run\u00a0!MayaVi2\u00a0with\u00a0some\u00a0options\u00a0on\u00a0the\u00a0command\u00a0line,\u00a0thus\u00a0loading\u00a0directly\u00a0the\u00a0modules\u00a0and/or\u00a0the\u00a0filters\u00a0you\u00a0want\u00a0to\u00a0use.`\n",
      "\n",
      "Run MayaVi2 as is\n",
      "-----------------\n",
      "\n",
      "Note: It is supposed here, in order to work, that your PATH variable\n",
      "contains the directory where !MayaVi2 binary is installed (for instance,\n",
      "/usr/local/bin).\n",
      "\n",
      "Begin to run !MayaVi2:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "mayavi2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "!MayaVi2 will be launched with a TVTK Scene which is blank.\n",
      "\n",
      "`*\u00a0Let's\u00a0start\u00a0by\u00a0loading\u00a0some\u00a0data.\u00a0Go\u00a0into\u00a0File/Open/Vtk\u00a0file.\u00a0This\u00a0will\u00a0bring\u00a0up\u00a0a\u00a0file\u00a0dialogue,\u00a0use\u00a0this\u00a0to\u00a0select\u00a0the\u00a0heart.vtk\u00a0file\u00a0under\u00a0examples/data\u00a0directory.`\n",
      "\n",
      "`The\u00a0TVTK\u00a0Scene\u00a0has\u00a0not\u00a0changed,\u00a0but\u00a0you\u00a0see\u00a0that\u00a0the\u00a0file\u00a0is\u00a0loaded\u00a0by\u00a0looking\u00a0at\u00a0the\u00a0upper\u00a0left\u00a0window.`\n",
      "\n",
      "`*\u00a0Now\u00a0that\u00a0we\u00a0have\u00a0data,\u00a0we\u00a0can\u00a0visualize\u00a0it.\u00a0First\u00a0lets\u00a0create\u00a0an\u00a0outline.\u00a0Click\u00a0on\u00a0\"VTK\u00a0File\u00a0(heart.vtk)\"\u00a0in\u00a0the\u00a0upper\u00a0left\u00a0window.`\n",
      "\n",
      "`Go\u00a0into\u00a0the\u00a0menu\u00a0item\u00a0Visualize/Modules/Outline.\u00a0This\u00a0creates\u00a0an\u00a0Outline\u00a0object.\u00a0We\u00a0can\u00a0edit\u00a0the\u00a0properties\u00a0of\u00a0the\u00a0outline\u00a0in\u00a0the\u00a0object\u00a0editor,\u00a0and\u00a0we\u00a0can\u00a0rotate\u00a0and\u00a0manipulate\u00a0the\u00a0object\u00a0in\u00a0the\u00a0scene\u00a0editor.`\n",
      "\n",
      "`*\u00a0Now\u00a0lets\u00a0add\u00a0three\u00a0grid\u00a0planes.`\n",
      "\n",
      "`Select\u00a0Visualize/Modules/!GridPlane,\u00a0this\u00a0create\u00a0a\u00a0grid\u00a0plane\u00a0in\u00a0the\u00a0X\u00a0axis.\u00a0We\u00a0can\u00a0create\u00a0two\u00a0more\u00a0grid\u00a0planes.\u00a0By\u00a0selecting\u00a0Axis\u00a0in\u00a0object\u00a0editor,\u00a0we\u00a0can\u00a0set\u00a0those\u00a0grid\u00a0planes\u00a0in\u00a0the\u00a0Y\u00a0and\u00a0Z\u00a0axis.`\n",
      "\n",
      "`*\u00a0We\u00a0can\u00a0project\u00a0the\u00a0object\u00a0onto\u00a0the\u00a0Grid\u00a0planes\u00a0using\u00a0contour\u00a0grid\u00a0planes.\u00a0Select\u00a0Visualize/Modules/Contour\u00a0grid\u00a0plane.\u00a0Do\u00a0this\u00a0for\u00a0the\u00a0Y,\u00a0and\u00a0Z\u00a0planes\u00a0as\u00a0well.`\n",
      "\n",
      "`*\u00a0Now\u00a0we\u00a0can\u00a0look\u00a0at\u00a0our\u00a0data\u00a0by\u00a0selecting\u00a0Visualize/Modules/Isosurface.`\n",
      "\n",
      "`*\u00a0We\u00a0can\u00a0now\u00a0finish\u00a0adding\u00a0a\u00a0scalar\u00a0cut\u00a0plane\u00a0by\u00a0selecting\u00a0Visualize/Modules/Scalar\u00a0Cut\u00a0Plane.\u00a0By\u00a0clicking\u00a0on\u00a0the\u00a0white\u00a0arrow\u00a0we\u00a0can\u00a0move\u00a0the\u00a0plane\u00a0around.`\n",
      "\n",
      "The result should look like this (for issue concerning\n",
      "background/forground colors, see [:Cookbook/MayaVi/Tips:\n",
      "Cookbook/MayaVi/Tips]):\n",
      "\n",
      "![](files/attachments/MayaVi_RunningMayavi2/mv2.png\n",
      "\n",
      "Run MayaVi2 with some parameters: modules and filters available\n",
      "---------------------------------------------------------------\n",
      "\n",
      "In order to know what you can set as parameters on the command line,\n",
      "type"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "mayavi2 -h"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This will list all the available options. Amongst all these options are:\n",
      "\n",
      "`*\u00a0-d\u00a0file.vtk:\u00a0set\u00a0the\u00a0VTK\u00a0file\u00a0to\u00a0load\u00a0into\u00a0!MayaVi2;`\n",
      "\n",
      "`*\u00a0-m\u00a0`*`module`*`:\u00a0set\u00a0the\u00a0module\u00a0to\u00a0use.\u00a0The\u00a0following\u00a0list\u00a0displays\u00a0all\u00a0available\u00a0modules,\u00a0in\u00a0alphabetical\u00a0order\u00a0with\u00a0a\u00a0short\u00a0description\u00a0(taken\u00a0from\u00a0Python\u00a0doc\u00a0files):`\n",
      "\n",
      "`\u00a0*\u00a0`*`Axes`*`:\u00a0draws\u00a0a\u00a0simple\u00a0axes\u00a0using\u00a0tvtk.!CubeAxesActor;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!ContourGridPlane`*`:\u00a0a\u00a0contour\u00a0grid\u00a0plane\u00a0module.\u00a0This\u00a0module\u00a0lets\u00a0one\u00a0take\u00a0a\u00a0slice\u00a0of\u00a0input\u00a0grid\u00a0data\u00a0and\u00a0view\u00a0contours\u00a0of\u00a0the\u00a0data.\u00a0The\u00a0module\u00a0only\u00a0works\u00a0for\u00a0structured\u00a0points,\u00a0rectilinear\u00a0grid\u00a0and\u00a0structured\u00a0grid\u00a0input.`\n",
      "\n",
      "`\u00a0*\u00a0`*`!CustomGridPlane`*`:\u00a0a\u00a0custom\u00a0grid\u00a0plane\u00a0with\u00a0a\u00a0lot\u00a0more\u00a0flexibility\u00a0than\u00a0!GridPlane.\u00a0This\u00a0also\u00a0only\u00a0works\u00a0for\u00a0non-unstructured/non-polygonal\u00a0datasets.`\n",
      "\n",
      "`\u00a0*\u00a0`*`Glyph`*`:\u00a0displays\u00a0different\u00a0types\u00a0of\u00a0glyphs\u00a0oriented\u00a0and\u00a0colored\u00a0as\u00a0per\u00a0scalar\u00a0or\u00a0vector\u00a0data\u00a0at\u00a0the\u00a0input\u00a0points;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!GridPlane`*`:\u00a0a\u00a0simple\u00a0grid\u00a0plane\u00a0module;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!ImagePlaneWidget`*`:\u00a0a\u00a0simple\u00a0!ImagePlaneWidget\u00a0module\u00a0to\u00a0view\u00a0image\u00a0data;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!IsoSurface`*`:\u00a0an\u00a0!IsoSurface\u00a0module\u00a0that\u00a0allows\u00a0the\u00a0user\u00a0to\u00a0make\u00a0contours\u00a0of\u00a0input\u00a0point\u00a0data;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!OrientationAxes`*`:\u00a0creates\u00a0a\u00a0small\u00a0axes\u00a0on\u00a0the\u00a0side\u00a0that\u00a0indicates\u00a0the\u00a0position\u00a0of\u00a0the\u00a0co-ordinate\u00a0axes\u00a0and\u00a0thereby\u00a0marks\u00a0the\u00a0orientation\u00a0of\u00a0the\u00a0scene.\u00a0It\u00a0uses\u00a0the\u00a0!OrientationMarkerWidget\u00a0which\u00a0requires\u00a0VTK-4.5\u00a0and\u00a0above.`\n",
      "\n",
      "`\u00a0*\u00a0`*`Outline`*`:\u00a0an\u00a0outline\u00a0module\u00a0that\u00a0draws\u00a0an\u00a0outline\u00a0for\u00a0the\u00a0given\u00a0data;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!ScalarCutPlane`*`:\u00a0takes\u00a0a\u00a0cut\u00a0plane\u00a0of\u00a0any\u00a0input\u00a0data\u00a0set\u00a0using\u00a0an\u00a0implicit\u00a0plane\u00a0and\u00a0plots\u00a0the\u00a0data\u00a0with\u00a0optional\u00a0contouring\u00a0and\u00a0scalar\u00a0warping;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!SliceUnstructuredGrid`*`:\u00a0this\u00a0module\u00a0takes\u00a0a\u00a0slice\u00a0of\u00a0the\u00a0unstructured\u00a0grid\u00a0data\u00a0and\u00a0shows\u00a0the\u00a0cells\u00a0that\u00a0intersect\u00a0or\u00a0touch\u00a0the\u00a0slice;`\n",
      "\n",
      "`\u00a0*\u00a0`*`Streamline`*`:\u00a0allows\u00a0the\u00a0user\u00a0to\u00a0draw\u00a0streamlines\u00a0for\u00a0given\u00a0vector\u00a0data.\u00a0This\u00a0supports\u00a0various\u00a0types\u00a0of\u00a0seed\u00a0objects\u00a0(line,\u00a0sphere,\u00a0plane\u00a0and\u00a0point\u00a0seeds).\u00a0It\u00a0also\u00a0allows\u00a0the\u00a0user\u00a0to\u00a0draw\u00a0ribbons\u00a0or\u00a0tubes\u00a0and\u00a0further\u00a0supports\u00a0different\u00a0types\u00a0of\u00a0interactive\u00a0modes\u00a0of\u00a0calculating\u00a0the\u00a0streamlines.`\n",
      "\n",
      "`\u00a0*\u00a0`*`!StructuredGridOutline`*`:\u00a0draws\u00a0a\u00a0grid-conforming\u00a0outline\u00a0for\u00a0structured\u00a0grids;`\n",
      "\n",
      "`\u00a0*\u00a0`*`Surface`*`:\u00a0draws\u00a0a\u00a0surface\u00a0for\u00a0any\u00a0input\u00a0dataset\u00a0with\u00a0optional\u00a0contouring;`\n",
      "\n",
      "`\u00a0*\u00a0`*`Text`*`:\u00a0this\u00a0module\u00a0allows\u00a0the\u00a0user\u00a0to\u00a0place\u00a0text\u00a0on\u00a0the\u00a0screen;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!VectorCutPlane`*`:\u00a0takes\u00a0an\u00a0arbitrary\u00a0slice\u00a0of\u00a0the\u00a0input\u00a0data\u00a0using\u00a0an\u00a0implicit\u00a0cut\u00a0plane\u00a0and\u00a0places\u00a0glyphs\u00a0according\u00a0to\u00a0the\u00a0vector\u00a0field\u00a0data.\u00a0The\u00a0glyphs\u00a0may\u00a0be\u00a0colored\u00a0using\u00a0either\u00a0the\u00a0vector\u00a0magnitude\u00a0or\u00a0the\u00a0scalar\u00a0attributes.`\n",
      "\n",
      "`\u00a0*\u00a0`*`Vectors`*`:\u00a0displays\u00a0different\u00a0types\u00a0of\u00a0glyphs\u00a0oriented\u00a0and\u00a0colored\u00a0as\u00a0per\u00a0vector\u00a0data\u00a0at\u00a0the\u00a0input\u00a0points.\u00a0This\u00a0is\u00a0merely\u00a0a\u00a0convenience\u00a0module\u00a0that\u00a0is\u00a0entirely\u00a0based\u00a0on\u00a0the\u00a0Glyph\u00a0module.`\n",
      "\n",
      "`\u00a0*\u00a0`*`Volume`*`:\u00a0the\u00a0Volume\u00a0module\u00a0visualizes\u00a0scalar\u00a0fields\u00a0using\u00a0volumetric\u00a0visualization\u00a0techniques.\u00a0This\u00a0supports\u00a0!ImageData\u00a0and\u00a0!UnstructuredGrid\u00a0data.\u00a0It\u00a0also\u00a0supports\u00a0the\u00a0!FixedPointRenderer\u00a0for\u00a0!ImageData.\u00a0However,\u00a0the\u00a0performance\u00a0is\u00a0slow\u00a0so\u00a0your\u00a0best\u00a0bet\u00a0is\u00a0probably\u00a0with\u00a0the\u00a0!ImageData\u00a0based\u00a0renderers.`\n",
      "\n",
      "`\u00a0*\u00a0`*`!WarpVectorCutPlane`*`:\u00a0takes\u00a0an\u00a0arbitrary\u00a0slice\u00a0of\u00a0the\u00a0input\u00a0data\u00a0using\u00a0an\u00a0implicit\u00a0cut\u00a0plane\u00a0and\u00a0warps\u00a0it\u00a0according\u00a0to\u00a0the\u00a0vector\u00a0field\u00a0data.\u00a0The\u00a0scalars\u00a0are\u00a0displayed\u00a0on\u00a0the\u00a0warped\u00a0surface\u00a0as\u00a0colors.`\n",
      "\n",
      "`*\u00a0-f\u00a0`*`filter`*`:\u00a0set\u00a0the\u00a0filter\u00a0to\u00a0use\u00a0(load\u00a0it\u00a0before\u00a0module\u00a0if\u00a0you\u00a0want\u00a0to\u00a0see\u00a0your\u00a0data\u00a0filtered).\u00a0Available\u00a0filters\u00a0are:`\n",
      "\n",
      "`\u00a0*\u00a0`*`!CellToPointData`*`:\u00a0transforms\u00a0cell\u00a0attribute\u00a0data\u00a0to\u00a0point\u00a0data\u00a0by\u00a0averaging\u00a0the\u00a0cell\u00a0data\u00a0from\u00a0the\u00a0cells\u00a0at\u00a0the\u00a0point.`\n",
      "\n",
      "`\u00a0*\u00a0`*`Delaunay2D`*`:\u00a0performs\u00a0a\u00a02D\u00a0Delaunay\u00a0triangulation\u00a0using\u00a0the\u00a0tvtk.Delaunay2D\u00a0class;`\n",
      "\n",
      "`\u00a0*\u00a0`*`Delaunay3D`*`:\u00a0performs\u00a0a\u00a03D\u00a0Delaunay\u00a0triangulation\u00a0using\u00a0the\u00a0tvtk.Delaunay3D\u00a0class;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!ExtractGrid`*`:\u00a0allows\u00a0a\u00a0user\u00a0to\u00a0select\u00a0a\u00a0part\u00a0of\u00a0a\u00a0structured\u00a0grid;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!ExtractUnstructuredGrid`*`:\u00a0allows\u00a0a\u00a0user\u00a0to\u00a0select\u00a0a\u00a0part\u00a0of\u00a0an\u00a0unstructured\u00a0grid;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!ExtractVectorNorm`*`:\u00a0computes\u00a0the\u00a0norm\u00a0(Eucliedean)\u00a0of\u00a0the\u00a0input\u00a0vector\u00a0data\u00a0(with\u00a0optional\u00a0scaling\u00a0between\u00a0[0,\u00a01]).\u00a0This\u00a0is\u00a0useful\u00a0when\u00a0the\u00a0input\u00a0data\u00a0has\u00a0vector\u00a0input\u00a0but\u00a0no\u00a0scalar\u00a0data\u00a0for\u00a0the\u00a0magnitude\u00a0of\u00a0the\u00a0vectors.`\n",
      "\n",
      "`\u00a0*\u00a0`*`!MaskPoints`*`:\u00a0selectively\u00a0passes\u00a0the\u00a0input\u00a0points\u00a0downstream.\u00a0This\u00a0can\u00a0be\u00a0used\u00a0to\u00a0subsample\u00a0the\u00a0input\u00a0points.\u00a0Note\u00a0that\u00a0this\u00a0does\u00a0not\u00a0pass\u00a0geometry\u00a0data,\u00a0this\u00a0means\u00a0all\u00a0grid\u00a0information\u00a0is\u00a0lost.`\n",
      "\n",
      "`\u00a0*\u00a0`*`!PointToCellData`*`:\u00a0does\u00a0the\u00a0inverse\u00a0of\u00a0the\u00a0!CellToPointData\u00a0filter;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!PolyDataNormals`*`:\u00a0computes\u00a0normals\u00a0from\u00a0input\u00a0data.\u00a0This\u00a0gives\u00a0meshes\u00a0a\u00a0smoother\u00a0appearance.\u00a0This\u00a0should\u00a0work\u00a0for\u00a0any\u00a0input\u00a0dataset.\u00a0Note:\u00a0this\u00a0filter\u00a0is\u00a0called\u00a0\"Compute\u00a0Normals\"\u00a0in\u00a0!MayaVi2\u00a0GUI\u00a0(Visualize/Filters/Compute\u00a0Normals).`\n",
      "\n",
      "`\u00a0*\u00a0`*`Threshold`*`:\u00a0a\u00a0simple\u00a0filter\u00a0that\u00a0thresholds\u00a0on\u00a0input\u00a0data;`\n",
      "\n",
      "`\u00a0*\u00a0`*`!TransformData`*`:\u00a0performs\u00a0a\u00a0linear\u00a0transformation\u00a0to\u00a0input\u00a0data\u00a0using\u00a0a\u00a0tvtk.!BoxWidget.\u00a0This\u00a0does\u00a0not\u00a0work\u00a0with\u00a0!ImageData/StructuredPoints.`\n",
      "\n",
      "`\u00a0*\u00a0`*`!WarpScalar`*`:\u00a0warps\u00a0the\u00a0input\u00a0data\u00a0along\u00a0a\u00a0particular\u00a0direction\u00a0(either\u00a0the\u00a0normals\u00a0or\u00a0a\u00a0specified\u00a0direction)\u00a0with\u00a0a\u00a0scale\u00a0specified\u00a0by\u00a0the\u00a0local\u00a0scalar\u00a0value.\u00a0Useful\u00a0for\u00a0making\u00a0carpet\u00a0plots.`\n",
      "\n",
      "`\u00a0*\u00a0`*`!WarpVector`*`:\u00a0warps\u00a0the\u00a0input\u00a0data\u00a0along\u00a0a\u00a0the\u00a0point\u00a0vector\u00a0attribute\u00a0scaled\u00a0as\u00a0per\u00a0a\u00a0scale\u00a0factor.\u00a0Useful\u00a0for\u00a0showing\u00a0flow\u00a0profiles\u00a0or\u00a0displacements.`\n",
      "\n",
      "Ok, you think you'll get rapidly tired to type all these long name\n",
      "modules and filters ? Don't worry, use your shell completion command !\n",
      "\n",
      "For instance, for (t)csh shell, you can put this line in your\n",
      "configuration shell file:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "complete mayavi2 c/-/\"(3 d f m n M p q w x z)\"/ n/-3/f:*.3ds/ n/-d/f:*.vt?/ n/-f/\"(CellToPointData Delaunay2D Delaunay3D ExtractGrid ExtractUnstructuredGrid ExtractVectorNorm MaskPoints PointToCellData PolyDataNormals Threshold TransformData WarpScalar WarpVector)\"/ n/-m/\"(Axes ContourGridPlane CustomGridPlane Glyph GridPlane ImagePlaneWidget IsoSurface Outline OrientationAxes ScalarCutPlane SliceUnstructuredGrid Streamline StructuredGridOutline Surface Text Vectors VectorCutPlane Volume WarpVectorCutPlane)\"/ n/-p/f:{*xyz.bin,*.xyz}/ n/-q/f:{*q.bin,*.q}/ n/-w/f:*.wrl/ n/-x/f:*.py/ n/-z/f:*.mv2/"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Quite long to type the first time, but once typed, no more effort load\n",
      "the module or filter you want to use ! ;-)\n",
      "\n",
      "Thus, typing (in !MayaVi2's examples directory, see\n",
      "[:Cookbook/MayaVi/Installation: Cookbook/MayaVi/Installation]):"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "mayavi2 -d data/heart.vtk -m Outline -m GridPlane -m GridPlane -m GridPlane -m ContourGridPlane -m ContourGridPlane -m IsoSurface -m ScalarCutPlane"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "you should get this:\n",
      "\n",
      "![](files/attachments/MayaVi_RunningMayavi2/mv2_cmdline.png)\n",
      "\n",
      "Ok, this is not exactly the same as on the previous figure although exactly the same modules have been loaded.\n",
      "\n",
      "The reason is that you did not set (and you can not, AFAIK) some modules properties, such as iso-value for !Iso\n",
      "Surface module, normals to the !GridPlane, etc.\n",
      "\n",
      "Hopefully, you can set these parameters \"by hand\" using the GUI.\n",
      "\n",
      "So now, let's play with this GUI ;-)\n",
      "\n",
      "## Moving around\n",
      "\n",
      "So, you can see on these two figures the render window on the right (TVTK Scene) beside the modules tree on the\n",
      " left. Let's consider the first figure.\n",
      "\n",
      "You can handle rendering scene with the mouse as usual using OpenGL:\n",
      "\n",
      " * moving the mouse with the left button pressed rotates the scene;\n",
      "\n",
      " * moving the mouse with middle button pressed translates it;\n",
      "\n",
      " * and moving the mouse with right button pressed zooms in/out (note: you can also use the wheel of your mouse, if you get one).\n",
      "\n",
      "Note: You can get a \"predefined\" angle of view (normal to x axis, y or z) clicking on\n",
      "the \"View\" item or on each small icons (first X: Ox axis points backwards you, second X: Ox axis points towards you, etc...)\n",
      "\n",
      "On the left of the window, you can see which modules are loaded (\"TVTK Scene\" is the \"root\" of\n",
      "the scene, and \"VTK file\" is the data source, i.e. the heart.vtk file):\n",
      "\n",
      " * \"Outline\" module displays the box surrounding the scene;\n",
      "\n",
      " * you have three grid planes (\"!GridPlane\" module), at coordinates x = 0, y = 0, and z = 0;\n",
      "\n",
      " * two contour grid planes (\"!ContourGridPlane\" module): the first displays contour lines (vertically), the second, the cutplane at z = const;\n",
      "\n",
      " * \"!IsoSurface\" module displays the heart as yellow;\n",
      "\n",
      "\n",
      " * the last cutplane (vertically, at y = const) is displayed by the \"!ScalarCutPlane\" module.\n",
      "\n",
      "Note that no filter is used in these scenes.\n",
      "\n",
      "Using each module/filter is very intuitive. Click on your module/filter in the tree and set some\n",
      "parameters with the mouse or enter some values at the keyboard, in the window at the\n",
      "bottom left of the GUI.\n",
      "\n",
      "If you want to copy/paste/delete/cut a given module/filter, click on it with the right button. A small window popups, with a items list.\n",
      "\n",
      "Note: You can get a larger window double-clicking on the choosen module/filter in the tree.\n",
      "\n",
      "To load other modules or add filters, click on the \"Visualize\" item at the top of the window.\n",
      "\n",
      "At last, you can also load another VTK data file, load/save the scene in a \"!MayaVi2\" file (with extension .mv2), or convert it to the image format you want (PNG, JPEG...), clicking on the \"File\" item or on the appropriate icon (small floppy disk).\n",
      "\n",
      "You can also get your scene in full-screen clicking on the small icon representing four red arrows in a little square. To disable full-screen mode, type 'e' or 'q'.\n",
      "\n",
      "This is the simplest way to use !MayaVi2. You are recalled here that you can also try ''mayavi2 -h'' to see what options and arguments you can add to the !MayaVi2 command line.\n"
     ]
    }
   ],
   "metadata": {}
  }
 ]
}